package algame;

import algame.MeshLoader;

public class Instance {
	private float[] position = new float[3];
	private float[] color = new float[3];
	private float[] rotation = new float[4];
	private float[] scale = new float[3];
	private int meshid = 0;

	public void smeshid(int _meshid) {
		meshid = _meshid;
	}

	public void sposition(float px, float py, float pz) {
		position[0] = px;
		position[1] = py;
		position[2] = pz;
	}

	public void srotation(float angle, float rx, float ry, float rz) {
		rotation[0] = angle;
		rotation[1] = rx;
		rotation[2] = ry;
		rotation[3] = rz;
	}

	public void sscale(float sx, float sy, float sz) {
		scale[0] = sx;
		scale[1] = sy;
		scale[2] = sz;
	}

	public void scolor(float cr, float cg, float cb) {
		color[0] = cr;
		color[1] = cg;
		color[2] = cb;
	}

	public void render() {
		MeshLoader.spos(position[0], position[1], position[2]);
		MeshLoader.srot(rotation[0], rotation[1], rotation[2], rotation[3]);
		MeshLoader.scol(color[0], color[1], color[2]);
		MeshLoader.ssca(scale[0], scale[1], scale[2]);
		MeshLoader.render(meshid);
	}

}
